﻿using Abp.Runtime.Validation;
using Mt.Site.Core.Navigations.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Application.Modules.Dto
{
    public class UpdateModuleDto : IShouldNormalize
    {
        public Guid Id { get; set; }

        public DateTime? LastModificationTime { get; set; }


        public bool IsActive { get; set; }

        [StringLength(BackEndModule.MaxNameLength)]
        public string Name { get; set; }

        [Required]
        [StringLength(BackEndModule.MaxDisplayNameLength)]
        public string DisplayName { get; set; }

        [StringLength(BackEndModule.MaxDescriptionLength)]
        public string Description { get; set; }

        [StringLength(150)]
        public string Icon { get; set; }

        [StringLength(300)]
        public string Url { get; set; }

        [StringLength(20)]
        public string Target { get; set; }

        public int Order { get; set; }

        [StringLength(BackEndModule.MaxCustomDataLength)]
        public string CustomData { get; set; }

        public List<string> RequiredFeatures { get; set; }

        public bool RequiresAll { get; set; }

        public void Normalize()
        {
            if (Target == "#")
            {
                Target = null;
            }
        }
    }
}
